import axios from 'axios';
import Config from 'react-native-config';

axios.defaults.baseURL=Config.API_URL;
axios.defaults.headers = {
  icode: 'D616647204EAB930'
}

//添加请求拦截器
axios.interceptors.request.use(function(config){
  return config;
}, function(error) {
  console.log('request error: ', error);
  return Promise.reject(error);
})

//添加响应拦截器
axios.interceptors.response.use(function(response){
  return response.data;
}, function(error){
  return Promise.reject(error);
})